home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8356 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: quark.enet.dec.com!LIONEL
  2. From: lionel@quark.enet.dec.com (Steve Lionel)
  3. Newsgroups: comp.lang.c++,comp.lang.fortran
  4. Subject: Re: Calling C++ from FORTRAN on VMS
  5. Date: 17 Feb 1996 02:00:06 GMT
  6. Organization: Digital Equipment Corporation - Nashua, NH
  7. Message-ID: <4g3cr6$btn@zk2nws.zko.dec.com>
  8. References: <31239D17.3159@stsci.edu>,<1996Feb15.195246.1@sldb6.slac.stanford.edu>
  9. Reply-To: lionel@quark.enet.dec.com
  10. NNTP-Posting-Host: quark.zko.dec.com
  11.  
  12. In article <31239D17.3159@stsci.edu>, Scott Stallcup 
  13. <stallcup@stsci.edu> writes:
  14. >> I need to call a C++ routine from a FORTRAN routine on both
  15. >> VAX/VMS and AXP/VMS platforms.
  16. >
  17. >> The C++ documentation fails to mention mixed langage programs
  18. >> (other than calling C from C++)...
  19. >>
  20. >> Given the following example code, what compiler/linker options
  21. >> will resolve the c++ reference ?
  22. >>
  23. >>       program tfor
  24. >>       call tcxx ()
  25. >>       end
  26. >>
  27. >> #include <stdio.h>
  28. >>
  29. >> void tcxx (void)
  30. >>  {
  31. >>   printf ("Hello World\n");
  32. >>  }
  33.  
  34. If you've got a current version (6.2 or later - 6,2 was released in 1994) of 
  35. DEC Fortran on either platform, do this:
  36.  
  37.     program tfor
  38. cdec$ alias tcxx, 'tcxx'
  39.     call tcxx
  40.     end
  41.  
  42. For more info on the CDEC$ ALIAS directive, see the DEC Fortran Release Notes
  43. (it may be in the Language Reference Manual, depending on what edition you
  44. have) or HELP FORTRAN Statements Directive_Statements.  See the DEC Fortran
  45. User Manual for more information on mixed-language programming.
  46.  
  47. Steve Lionel                      Mail: lionel@quark.enet.dec.com
  48. Fortran Development               WWW:  http://www.digital.com/info/slionel.html
  49. Digital Equipment Corporation     CompuServe: 75263,3001
  50. 110 Spit Brook Road, ZKO2-3/N30
  51. Nashua, NH 03062-2698             "Free advice is worth every cent"
  52.  
  53. For information on Digital Fortran 90, see http://www.digital.com/info/hpc/f90/
  54.